package com.example.manager.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.example.manager.entity.Admin;
import com.example.manager.repository.AdminRepository;

@Service
@Transactional
public class AdminServiceImpl implements AdminService {
	
	@Autowired
	private AdminRepository adminRepository;

	@Override
	public String editAdmin(Admin admin) {
		if(admin.getPassword()==null||admin.getPassword().length()==0) {
			return "imcomplete info";
		}
		adminRepository.save(admin);
		return "success";
	}

}